package com.demo02;

public class UserServiceProxy implements UserService{
    private UserServiceImpl userService;

    public void setUserService(UserServiceImpl userService) {
        this.userService = userService;
    }

    public void add() {
        log("add");
        userService.add();
    }

    public void update() {
        log("update");
        userService.update();
    }

    public void delete() {
        log("delete");
        userService.delete();
    }

    public void search() {
        log("search");
        userService.search();
    }
    public void log(String name){
        System.out.println("[日志] 使用了 "+name+" 方法");
    }
}
